﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using yunbo.Model.PPMS;
using yunbo.Repositorys.PPMSRepositorys;

namespace yunbo.Controllers.PPMSControllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class Scdd_CpController : ControllerBase
    {
        Scdd_CpRepoditory bD_CPRepository = new Scdd_CpRepoditory();


        [HttpGet("GetScdd_Cp")]
        public IActionResult GetScdd_Cp(string scdd_code)
        {
            List<Scdd_Cp> quans = bD_CPRepository.GetScdd_Cp(scdd_code);
            return Ok(quans);
        }
        [HttpPost("AddScdd_Cp")]
        public IActionResult AddScdd_Cp(Scdd_Cp scdd_Cp)
        {
            var quans = bD_CPRepository.AddScdd_Cp(scdd_Cp);
            return Ok(quans);
        }

        [HttpPut("UpdateScdd_Cp")]
        public IActionResult UpdateScdd_Cp(Scdd_Cp scdd_Cp)
        {
            var quans = bD_CPRepository.UpdateScdd_Cp(scdd_Cp);
            return Ok(quans);
        }
    }
}
